package com.matrix.java.chap_07;

import com.matrix.java.util.ArrayUtil;

import java.util.Scanner;

/*
    求数组的平均值
 */
public class Ex7_08 {
    public static void main(String[] args) {
        double[] array = new double[10];
        System.out.print("输入10个数: ");
        Scanner input = new Scanner(System.in);
        for (int i = 0; i < 10; i++) {
            array[i]=input.nextDouble();
        }
        input.close();
        System.out.println("avg: "+ ArrayUtil.average(array));
    }
}
